package extend02;



public class demo02 {
    public static void main(String[] args) {
        Teacher t = new Teacher();
        t.setName("老王");
        t.setSalary(5000);

        t.eat();//调用继承的eat方法
        t.teach();
        System.out.println(Teacher.class.getSuperclass());//获取Teacher类的爸爸

        System.out.println("-----------------------");
        Student student = new Student();
        student.setName("张三");
        student.setSno("20140987");

        student.eat();
        student.study();
        System.out.println(Student.class.getSuperclass());//获取Student类的爸爸
    }
}
